﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0037)http://news.goocar.net/daiLiMaps.html -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>经销商分布图</title>
    <style type="text/css">
        BODY { margin: 0px; width: 100%; height: 100%; }
        HTML { margin: 0px; width: 100%; height: 100%; }
        #map { margin: 0px; width: 100%; height: 100%; }
    </style>
    <meta content="text/html; charset=utf-8" http-equiv="content-type" />    
    <script type="text/javascript" src="googleMapInc/key.js"></script>
    <script type="text/javascript">
//<![CDATA[
        loadGoogleJS();
        //window.onload = loadGoogleJS();
//]]>
</script>
    <script type="text/javascript" src="googleMapInc/myjsframe.js"></script>
    <script type="text/javascript" src="googleMapInc/maps.js"></script>
    <script type="text/javascript" src="googleMapInc/mm.js"></script>
    <script type="text/javascript" src="googleMapInc/daili.js"></script>
    <script type="text/javascript" src="googleMapInc/popupmarker.js"></script>
    <script type="text/javascript">
    //<![CDATA[

        var icon = new GIcon();

        icon.image = "googleMapInc/redflag.gif";
        icon.iconSize = new GSize(34, 25);
        icon.iconAnchor = new GPoint(6, 20);
        icon.infoWindowAnchor = new GPoint(10, 1);


        function load() {
            if (GBrowserIsCompatible()) {
                map = new GMap2(document.getElementById("map"));

                map.addControl(new GLargeMapControl());
                map.setCenter(new GLatLng(31.2328, 121.4489), 10);

                GEvent.addListener(map, "zoomend", function () {
                    hideAllOpts();
                });
                var green_icon = getIcon("red");

                var initMTitle = "公司名称：............................................................<br>";
                initMTitle += "地址：..........................................................<br>";
                initMTitle += "联系方式：.........................................<br>";
                initMTitle += "联系人：.............................................";

                var markers = new Array();
                var overListeners = new Array();
                var outLinstener = new Array();
                var dbClickLinstener = new Array();

                setMarkers();

                function hideAllOpts() {
                    for (var j = markers.length - 1; j >= 0; j--) {
                        markers[j].hidePopup();
                    }
                }

                function setMarker(i) {
                    var mtitle = "公司名称：" + name[i] + "<br>";
                    mtitle += "地址：" + addr[i] + "<br>";
                    mtitle += "联系方式：" + tel[i] + "<br>";
                    mtitle += "联系人：" + contact[i];                    
                    var opts = { text: "<span id='markerText" + i + "'><font size='2'>" + mtitle + "</font></span>", icon: icon };
                    var marker = new PopupMarker(new GLatLng(weidu[i], jingdu[i]), opts);
                    overListeners.push(GEvent.addListener(marker, "mouseover", function () {
                        marker.showPopup();
                    }));
                    outLinstener.push(GEvent.addListener(marker, "mouseout", function () {
                        marker.hidePopup();
                    }));
                    dbClickLinstener.push(GEvent.addListener(marker, "dblclick", function () {
                        map.setCenter(marker.getLatLng(), 14);
                        marker.showPopup();
                    }));
                    markers[i] = marker;
                    map.addOverlay(markers[i]);                    
                    markers[i].hidePopup();
                }
                function setMarkers() {
                    for (var i = 0; i < name.length; i++) {
                        if (ok[i] == 1)
                            setMarker(i);

                    }
                }
            }


        }
    //]]>
    </script>
    <meta name="GENERATOR" content="MSHTML 8.00.6001.18928" />
</head>
<body onunload="GUnload()" onload="load()">
    <table border="0" width="100%" height="100%">
        <tbody>
            <tr>
                <td height="100%" width="100%">
                    <div id="map">
                    </div>
                </td>
            </tr>
        </tbody>
    </table>
</body>
</html>
